package com.web.managedbean;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.primefaces.model.chart.BarChartModel;
import org.primefaces.model.chart.BubbleChartModel;
import org.primefaces.model.chart.LineChartModel;
import org.primefaces.model.chart.PieChartModel;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.constants.Constants;
import com.database.bean.Game;
import com.database.bean.ReportDecision;
import com.database.bean.Round;
import com.database.bean.User;
import com.math.util.ColumnModel;
import com.math.util.StatisticBean;

@ManagedBean(name="reportMBean")
@Controller
@SessionScoped
@Scope("session")
public class ReportMBean  extends AbstractManagedBean {

	private static final long serialVersionUID = 1L;
	
	private User company=null;
	private Game game=null;
	
	//Spying variables
	private String spyHeader="Company spying";
	private List<ReportDecision> reportDecisions=null;
	/** selected reportDecision to show **/
	private ReportDecision selectedRepDec = null;
	
	//amount of competing companies
	private String amountCompanies=null;
	//amount of all previous agents
	private String amountAgents=null;
	//amount of previous provided companyProducts
	private String amountCompanyProducts=null;
	//amount of previous provided different Products
	private String amountDifferentProducts=null;
	
	//Company Products Table and Columns
	private List<StatisticBean> companyProductTable=null;
	private List<ColumnModel> columns = new ArrayList<ColumnModel>();
	
	//Table and columns for Company Decisions
	private List<StatisticBean> companyDecisionsTable=null;
	private List<ColumnModel> companyDecisionColumns = new ArrayList<ColumnModel>();
	
	//Table and columns for SummedUp Company Decisions
	private List<StatisticBean> companySummedUpDecisionsTable=null;
	private List<ColumnModel> companySummedUpDecisionColumns = new ArrayList<ColumnModel>();
	
	//Table and columns for agents
	private List<StatisticBean> agentsTable=null;
	private List<ColumnModel> agentsColumns = new ArrayList<ColumnModel>();
	private String avgAgentPreference=null;
	
	private List<StatisticBean> spyingCompDecData=null;
	private List<ColumnModel> spyingCompDecColumns = new ArrayList<ColumnModel>();
	
	private List<StatisticBean> spyingCompProdData=null;
	private List<ColumnModel> spyingCompProdColumns = new ArrayList<ColumnModel>();
	
	//Own company investment decisions of last rounds
	private List<StatisticBean> ownCompDecData=null;
	private List<ColumnModel> ownCompDecColumns = new ArrayList<ColumnModel>();
	
	//Own company product decisions of last rounds
	private List<StatisticBean> ownCompProdData=null;
	private List<ColumnModel> ownCompProdColumns = new ArrayList<ColumnModel>();
	
	//PieChart: which company, how many sellings in specific round
	private PieChartModel pieChartMarketLastRoundSellings;
	//BubbleChart: different products before deadlineRound with sellings (amountSold)
	private BubbleChartModel bubbleChartMarketLastRoundProducts;
	//BarChart: products with sellings before deadlineRound
	private BarChartModel barChartMarketGameProductSellings;
	
	//number of agents with specific preferenceQuality before deadlineRound
	private BarChartModel barChartQualityModel;
	//number of agents with specific preferencePrice before deadlineRound
	private BarChartModel barChartPriceModel;
	//number of agents with specific preferenceImage before deadlineRound
	private BarChartModel barChartImageModel;
	
	//the whole amount of sold products of a company before deadlineRound
	private BarChartModel barChartMarketGameCompanySellings;
	//the round amount of sold products of a company before deadlineRound
	private LineChartModel barChartMarketGameCompanySellingsPerRoundLine;
	
	public ReportMBean() {
		super();
	}
	
	@PostConstruct
	public void init() {
		
		FacesContext context = FacesContext.getCurrentInstance();
		HttpServletRequest request = (HttpServletRequest) context
				.getExternalContext().getRequest();
		HttpSession httpSession = request.getSession(false);
		User user = (User) httpSession.getAttribute("user");
		if (user != null) {
			this.setCompany(user);
			this.setGame(user.getGame());
			
			//get the bought reports of the previous rounds (not actual round)
			Round actRound = this.game.getConfigurableRound();
			int addition=0;
			if(actRound==null){
				//there is no actual playable round
				//1. maybe the game is finished -> choose the last round of the game
				//if(game.isFinished){
				//actRound = this.game.getLastRound();
				//}else{
				//2. the last round is in simulation state -> choose the last already simulated round
				actRound = this.game.getLastSimulatedRound();
				addition=1;
				//}
			}
			this.reportDecisions = user.getAllPreviousMaidReportDecisions(actRound,addition);
		}
        
	}
	
	/**
	 * Returns competitor name for given id
	 * @param id
	 * @return
	 */
	public String getCompetitorName(Integer id){
		String nickname="";
		for(User usr:this.game.getUserList()){
			if(usr.getId()==id){
				nickname=usr.getNickname();
				break;
			}
		}
		return nickname;
	}
	
	/**
	 * Go to own decision overview and create the info tables
	 * @return
	 */
	public String navigateToOwnDecisions(){
		Round round = this.game.getPreviousRound();
		if(round==null){
			round = this.game.getLastSimulatedRound();
		}
		
		if (round != null) {
			this.generateOwnCompanyDecision(this.company,round);
			this.generateOwnCompanyProduct(this.company,round);
		}
		return "companyOwnDecisions?faces-redirect=true";
	}
	
	/**
	 * Generates reports depending on type (general, spying) and 
	 * then navigates to specific site (general, spying)
	 * The difference is if competitor is null or not
	 * @return navigation string
	 */
	public String actionGenerateReport(){
		
		game.getUsers();
		List<User> competitorList = game.getUserList();
		
		//if target company is not null, then it is a spying report
		//FIXME: not possible anymore
		if(this.selectedRepDec.getTargetCompany_Id()!=null){
			Integer selectedCompetitorID=this.selectedRepDec.getTargetCompany_Id();
			
			if (selectedCompetitorID != null) {
				for (User comp : competitorList) {
					if(comp.getId()==selectedCompetitorID){
						this.spyHeader = "Company spying of: " + comp.getNickname();
						this.generateSpyingCompanyDecision(comp, this.selectedRepDec.getDecRes().getRound());
						this.generateSpyingCompanyProduct(comp, this.selectedRepDec.getDecRes().getRound());
						break;
					}
				}
			}
			
			return "companySpying?faces-redirect=true";
		}else{
			//target company is null so it is a general report
			//now it is important to decide which type of general report small, middle, high, ....
			int type = this.selectedRepDec.getReport().getReportType();
			if(type>=1){
				//always
				this.generateGeneralInfo();
				this.generateCompanySummedUpDecisionsTable();
			}
			
			if(type>=2){
				this.generateMarketLastRoundSellingsPie();
			}
			
			if(type==1){
				this.generateAgentsTable(33);
			}
			
			if(type==2){
				this.generateCompanyDecisionsTablePercentage(50);
				this.generateAgentsTable(66);
			}
			
			if(type>=3){
				this.generateCompanyDecisionsTable();
				this.generateReportChartsCompanyProducts();
				this.generateAgentsTable(100);
			}
			
			return "companyBoughtAnalysis?faces-redirect=true";
		}
		
		
	}
	
	/**
	 * Generate a table for spying the companyProducts of the selected competitor
	 * @param competitor ... which we want to spy
	 */
	private void generateGeneralInfo(){
		Round deadlineRound = this.selectedRepDec.getDecRes().getRound();
		Integer agAmount = this.companyService.getMarketGameAgentAmount(game, deadlineRound);
		if(agAmount==null || agAmount==0){
			this.amountAgents = "0";
		}else{
			this.amountAgents = "" + agAmount;
		}
		
		if(game!=null && this.game.getUsers()!=null){
			this.amountCompanies = "" + this.game.getUsers().size();
		}else{
			this.amountCompanies = "0";
		}
		
		List<StatisticBean> sbList = this.companyService.getMarketGameAmounts(deadlineRound);
		if(sbList!=null && sbList.size()>0){
			StatisticBean sb = sbList.get(0);
			this.amountCompanyProducts = ""+sb.getAmountCompanyProducts();
			this.amountDifferentProducts = ""+sb.getAmountDifferentProducts();
		}
		
	}
	
	/**
	 * Generate a table for spying the companyProducts of the selected competitor
	 * @param competitor ... which we want to spy
	 */
	private void generateSpyingCompanyProduct(User competitor, Round deadlineRound){
		this.spyingCompProdData = new ArrayList<StatisticBean>();
		
		this.spyingCompProdData = this.companyService.getCompanyGameCompanyProducts(competitor, deadlineRound, true);
		
		Map<String, String> colMap = new LinkedHashMap<String,String>();
		colMap.put("company_nickname", "Competitor");
		colMap.put("round_number","Round number");
		colMap.put("product_name","Product name");
		colMap.put("supplier_name","Supplier name");
		colMap.put("product_qualityFactor","Product quality");
		colMap.put("product_productCosts","Product costs");
		colMap.put("compprod_sellingPrice","Selling price");
		colMap.put("compprod_amountSold","Amount sold");
		
		this.spyingCompProdColumns.clear();
		this.spyingCompProdColumns.addAll(ColumnModel.populateColumnsHM(colMap));
	}
	
	/**
	 * Generate a table for spying the companyProducts of the selected competitor
	 * @param competitor ... which we want to spy
	 */
	private void generateOwnCompanyProduct(User company, Round deadlineRound){
		this.ownCompProdData = new ArrayList<StatisticBean>();
		
		this.ownCompProdData = this.companyService.getCompanyGameCompanyProducts(company, deadlineRound, false);
		
		Map<String, String> colMap = new LinkedHashMap<String,String>();
		colMap.put("company_nickname", "Company");
		colMap.put("round_number","Round number");
		colMap.put("product_name","Product name");
		colMap.put("supplier_name","Supplier name");
		colMap.put("product_qualityFactor","Product quality");
		colMap.put("product_productCosts","Product costs");
		colMap.put("compprod_sellingPrice","Selling price");
		colMap.put("compprod_amountSold","Amount sold");
		
		this.ownCompProdColumns.clear();
		this.ownCompProdColumns.addAll(ColumnModel.populateColumnsHM(colMap));
	}
	
	/**
	 * Generate a table for spying the companyProducts of the selected competitor
	 * @param competitor ... which we want to spy
	 */
	private void generateSpyingCompanyDecision(User competitor, Round deadlineRound){
		this.spyingCompDecData = new ArrayList<StatisticBean>();
		
		this.spyingCompDecData = this.companyService.getCompanyGameDecisions(competitor, deadlineRound, true);
		
		Map<String, String> colMap = new LinkedHashMap<String,String>();
		colMap.put("company_nickname", "Competitor");
		colMap.put("round_number","Round number");
		colMap.put("decres_employerEducationInvestment","Personal");
		colMap.put("decres_marketingInvestment","Marketing");
		colMap.put("decres_rdInvestment","R&D");
		colMap.put("decres_newImage","Image");
		
		this.spyingCompDecColumns.clear();
		this.spyingCompDecColumns.addAll(ColumnModel.populateColumnsHM(colMap));
	}
	
	/**
	 * Generate a table for the companyProducts of the company
	 * @param company 
	 * @param deadlineRound
	 */
	private void generateOwnCompanyDecision(User company, Round deadlineRound){
		this.ownCompDecData = new ArrayList<StatisticBean>();
		
		this.ownCompDecData = this.companyService.getCompanyGameDecisions(company, deadlineRound, false);
		
		Map<String, String> colMap = new LinkedHashMap<String,String>();
		colMap.put("company_nickname", "Company");
		colMap.put("round_number","Round number");
		colMap.put("decres_employerEducationInvestment","Personal");
		colMap.put("decres_marketingInvestment","Marketing");
		colMap.put("decres_rdInvestment","R&D");
		colMap.put("decres_revenue","Revenue");
		colMap.put("decres_expenses","Expenses");
		colMap.put("decres_newBudget","Budget");
		colMap.put("decres_newImage","Image");
		colMap.put("decres_overdraftCosts","Overdraft Costs");
		colMap.put("decres_logisticCosts","Logistic Costs");
		colMap.put("decres_reportCosts","Report Costs");
		
		this.ownCompDecColumns.clear();
		this.ownCompDecColumns.addAll(ColumnModel.populateColumnsHM(colMap));
	}

	/**
	 * Creates Table where you can see the previous summed up decisions of 
	 * the other companies.
	 */
	private void generateCompanyDecisionsTable() {

		this.companyDecisionsTable = new ArrayList<StatisticBean>();
		Round deadlineRound = this.selectedRepDec.getDecRes().getRound();
		this.companyDecisionsTable = this.companyService.getMarketGameDecisionsDeadline(deadlineRound);

		Map<String, String> colMap = new LinkedHashMap<String, String>();
		colMap.put("company_nickname", "Company");
		colMap.put("round_number", "Round");
		colMap.put("decres_revenue","Revenue");
		colMap.put("decres_expenses","Expenses");
		colMap.put("decres_marketingInvestment","Marketing");
		colMap.put("decres_employerEducationInvestment","Personal");
		colMap.put("decres_rdInvestment","R&D");
		colMap.put("decres_newImage","Image");
		colMap.put("decres_newBudget","Budget");

		this.companyDecisionColumns.clear();
		this.companyDecisionColumns.addAll(ColumnModel.populateColumnsHM(colMap));

	}
	
	/**
	 * Creates Table where you can see the previous summed up decisions of 
	 * the other companies.
	 */
	private void generateCompanyDecisionsTablePercentage(double percentage) {

		this.companyDecisionsTable = new ArrayList<StatisticBean>();
		Round deadlineRound = this.selectedRepDec.getDecRes().getRound();
		this.companyDecisionsTable = this.companyService.getMarketGameDecisionsDeadlinePercentage(deadlineRound, percentage, this.company);
		
		Map<String, String> colMap = new LinkedHashMap<String, String>();
		colMap.put("company_nickname", "Company");
		colMap.put("round_number", "Round");
		colMap.put("decres_revenue","Revenue");
		colMap.put("decres_expenses","Expenses");
		colMap.put("decres_marketingInvestment","Marketing");
		colMap.put("decres_employerEducationInvestment","Personal");
		colMap.put("decres_rdInvestment","R&D");
		colMap.put("decres_newImage","Image");
		colMap.put("decres_newBudget","Budget");

		this.companyDecisionColumns.clear();
		this.companyDecisionColumns.addAll(ColumnModel.populateColumnsHM(colMap));

	}
	
	/**
	 * Creates Table where you can see the previous summed up decisions of 
	 * the all companies.
	 */
	private void generateCompanySummedUpDecisionsTable() {

		this.companySummedUpDecisionsTable = new ArrayList<StatisticBean>();
		Round deadlineRound = this.selectedRepDec.getDecRes().getRound();
		this.companySummedUpDecisionsTable = this.companyService.getMarketGameSummedUpDecisionsDeadline(deadlineRound);

		Map<String, String> colMap = new LinkedHashMap<String, String>();
		colMap.put("decres_revenue","Revenue");
		colMap.put("decres_expenses","Expenses");
		colMap.put("decres_marketingInvestment","Marketing");
		colMap.put("decres_employerEducationInvestment","Personal");
		colMap.put("decres_rdInvestment","R&D");

		this.companySummedUpDecisionColumns.clear();
		this.companySummedUpDecisionColumns.addAll(ColumnModel.populateColumnsHM(colMap));

	}
	
	/**
	 * Generate Agents Table
	 * List of agents with preferences 
	 * Amount of agents is specified with percentage (depending of bought report)
	 */
	private void generateAgentsTable(double percentage) {
		
		this.agentsTable = new ArrayList<StatisticBean>();
		Round deadlineRound = this.selectedRepDec.getDecRes().getRound();
		this.agentsTable = this.companyService.getMarketGameAgentPercentage(deadlineRound, percentage);

		Map<String, String> colMap = new LinkedHashMap<String, String>();
		colMap.put("agent_preferenceQuality", "Quality preference (0-1)");
		colMap.put("agent_preferencePrice", "Price preference (0-1)");
		colMap.put("agent_preferenceImage", "Image preference (0-1)");
		if(this.selectedRepDec.getReport().getReportType()>=3){
			colMap.put("product_name", "Chosen product");
		}

		this.agentsColumns.clear();
		this.agentsColumns.addAll(ColumnModel.populateColumnsHM(colMap));

		List<StatisticBean> sbList = this.companyService.getMarketGameAgentPreferencesPercentage(deadlineRound, percentage);
		if(sbList!=null && sbList.size()>0){
			StatisticBean sb = sbList.get(0);
			//set footer text for table with avg preferences
			if (sb.getAgent_preferenceQuality() == null
					|| sb.getAgent_preferencePrice() == null
					|| sb.getAgent_preferenceImage() == null) {
				this.avgAgentPreference = "";
			} else {
				this.avgAgentPreference = "Average quality preference: "
						+ sb.getAgent_preferenceQuality()
						+ ", average price preference: "
						+ sb.getAgent_preferencePrice()
						+ ", average image preference: "
						+ sb.getAgent_preferenceImage();
			}
		}
	}
	
	private void generateReportChartsCompanyProducts(){
		companyProductTable=new ArrayList<StatisticBean>();
		Round deadlineRound = this.selectedRepDec.getDecRes().getRound();
		this.companyProductTable=this.companyService.getMarketGameCompanyProducts(game, deadlineRound);
		
		Map<String, String> colMap = new LinkedHashMap<String,String>();
		colMap.put("company_nickname", "Competitor");
		colMap.put("round_number","Round number");
		colMap.put("product_name","Product name");
		colMap.put("supplier_name","Supplier name");
		colMap.put("product_qualityFactor","Product quality");
		colMap.put("product_productCosts","Product costs");
		colMap.put("compprod_sellingPrice","Selling price");
		colMap.put("compprod_amountSold","Amount sold");
		
		this.columns.clear();
		this.columns.addAll(ColumnModel.populateColumnsHM(colMap));
		
		//this.generateMarketLastRoundProductsBubble();
		//this.generateMarketGameProductSellingsBarChart();
		//this.generatePreferenceCharts();
		//this.generateMarketGameCompanySellingsCharts();
	}
	
	/**
	 * Generate MarketGameProductSellings report with deadline round
	 */
	private void generateMarketGameProductSellingsBarChart() {
		if (this.selectedRepDec != null
				&& this.selectedRepDec.getDecRes() != null) {
			Round deadlineRound = this.selectedRepDec.getDecRes().getRound();
			
			this.barChartMarketGameProductSellings = this.companyService
					.getMarketGameProductSellings(game, deadlineRound);
		}else{
			this.addErrorMessage(Constants.RMB_REPORTGENERATION_PROBLEM);
		}
	}
	
	/**
	 * Generate Agent Preference Charts: Quality, Price, Image
	 * Get number of agents with specific preference before deadlineRound
	 */
	private void generatePreferenceCharts() {
		if (this.selectedRepDec != null
				&& this.selectedRepDec.getDecRes() != null) {
			Round deadlineRound = this.selectedRepDec.getDecRes().getRound();
			this.barChartImageModel = this.companyService
					.getMarketGameAgentImage(game, deadlineRound);
			this.barChartPriceModel = this.companyService
					.getMarketGameAgentPrice(game, deadlineRound);
			this.barChartQualityModel = this.companyService
					.getMarketGameAgentQuality(game, deadlineRound);
		} else {
			this.addErrorMessage(Constants.RMB_REPORTGENERATION_PROBLEM);
		}
	}
	
	/**
	 * Generate MarketGAmeCompanySelligs BarChart
	 */
	private void generateMarketGameCompanySellingsCharts() {
		if (this.selectedRepDec != null
				&& this.selectedRepDec.getDecRes() != null) {
			Round deadlineRound = this.selectedRepDec.getDecRes().getRound();
			this.barChartMarketGameCompanySellingsPerRoundLine = this.companyService
					.getMarketGameCompanySellingsPerRoundLineChart(game, deadlineRound);
		} else {
			this.addErrorMessage(Constants.RMB_REPORTGENERATION_PROBLEM);
		}
	}
	
	/**
	 * Generate MarketLastRoundSellings Pie Chart Model
	 */
	private void generateMarketLastRoundSellingsPie(){
			
		if (this.selectedRepDec != null
				&& this.selectedRepDec.getDecRes() != null) {
			Round deadlineRound = this.selectedRepDec.getDecRes().getRound();
			
			this.pieChartMarketLastRoundSellings = this.companyService.getMarketLastRoundSellingsPie(game,deadlineRound);

		}else{
			this.addErrorMessage(Constants.RMB_REPORTGENERATION_PROBLEM);
		}
	}
	
	/**
	 * Generate MarketLastRoundProcuts Bubble Chart Model
	 * Get the different products before deadlineRound with sellings (amountSold)
	 */
	private void generateMarketLastRoundProductsBubble(){
		
		if (this.selectedRepDec != null
				&& this.selectedRepDec.getDecRes() != null) {
			Round deadlineRound = this.selectedRepDec.getDecRes().getRound();
			
			this.bubbleChartMarketLastRoundProducts = this.companyService.getMarketLastRoundsProductsBubble(game, deadlineRound);

		}else{
			this.addErrorMessage(Constants.RMB_REPORTGENERATION_PROBLEM);
		}
	}
	
	
	/**
	 * Generates data for the report table
	 * @return Navigation String
	 */
	public String generateReportTable(){
		
		return "";
	}

	/**
	 * @return the company
	 */
	public User getCompany() {
		return company;
	}

	/**
	 * @param company the company to set
	 */
	public void setCompany(User company) {
		this.company = company;
	}

	/**
	 * @return the game
	 */
	public Game getGame() {
		return game;
	}

	/**
	 * @param game the game to set
	 */
	public void setGame(Game game) {
		this.game = game;
	}

	/**
	 * @return the columns
	 */
	public List<ColumnModel> getColumns() {
		return columns;
	}

	/**
	 * @param columns the columns to set
	 */
	public void setColumns(List<ColumnModel> columns) {
		this.columns = columns;
	}

	/**
	 * @return the pieChartMarketLastRoundSellings
	 */
	public PieChartModel getPieChartMarketLastRoundSellings() {
		return pieChartMarketLastRoundSellings;
	}

	/**
	 * @param pieChartMarketLastRoundSellings the pieChartMarketLastRoundSellings to set
	 */
	public void setPieChartMarketLastRoundSellings(
			PieChartModel pieChartMarketLastRoundSellings) {
		this.pieChartMarketLastRoundSellings = pieChartMarketLastRoundSellings;
	}

	/**
	 * @return the bubbleChartMarketLastRoundProducts
	 */
	public BubbleChartModel getBubbleChartMarketLastRoundProducts() {
		return bubbleChartMarketLastRoundProducts;
	}

	/**
	 * @param bubbleChartMarketLastRoundProducts the bubbleChartMarketLastRoundProducts to set
	 */
	public void setBubbleChartMarketLastRoundProducts(
			BubbleChartModel bubbleChartMarketLastRoundProducts) {
		this.bubbleChartMarketLastRoundProducts = bubbleChartMarketLastRoundProducts;
	}

	/**
	 * @return the spyingCompDecColumns
	 */
	public List<ColumnModel> getSpyingCompDecColumns() {
		return spyingCompDecColumns;
	}

	/**
	 * @param spyingCompDecColumns the spyingCompDecColumns to set
	 */
	public void setSpyingCompDecColumns(List<ColumnModel> spyingCompDecColumns) {
		this.spyingCompDecColumns = spyingCompDecColumns;
	}

	/**
	 * @return the spyingCompProdColumns
	 */
	public List<ColumnModel> getSpyingCompProdColumns() {
		return spyingCompProdColumns;
	}

	/**
	 * @param spyingCompProdColumns the spyingCompProdColumns to set
	 */
	public void setSpyingCompProdColumns(List<ColumnModel> spyingCompProdColumns) {
		this.spyingCompProdColumns = spyingCompProdColumns;
	}

	/**
	 * @return the spyingCompDecData
	 */
	public List<StatisticBean> getSpyingCompDecData() {
		return spyingCompDecData;
	}

	/**
	 * @param spyingCompDecData the spyingCompDecData to set
	 */
	public void setSpyingCompDecData(List<StatisticBean> spyingCompDecData) {
		this.spyingCompDecData = spyingCompDecData;
	}

	/**
	 * @return the spyingCompProdData
	 */
	public List<StatisticBean> getSpyingCompProdData() {
		return spyingCompProdData;
	}

	/**
	 * @param spyingCompProdData the spyingCompProdData to set
	 */
	public void setSpyingCompProdData(List<StatisticBean> spyingCompProdData) {
		this.spyingCompProdData = spyingCompProdData;
	}

	/**
	 * @return the spyHeader
	 */
	public String getSpyHeader() {
		return spyHeader;
	}

	/**
	 * @param spyHeader the spyHeader to set
	 */
	public void setSpyHeader(String spyHeader) {
		this.spyHeader = spyHeader;
	}

	/**
	 * @return the reportDecisions
	 */
	public List<ReportDecision> getReportDecisions() {
		return reportDecisions;
	}

	/**
	 * @param reportDecisions the reportDecisions to set
	 */
	public void setReportDecisions(List<ReportDecision> reportDecisions) {
		this.reportDecisions = reportDecisions;
	}

	/**
	 * @return the selectedRepDec
	 */
	public ReportDecision getSelectedRepDec() {
		return selectedRepDec;
	}

	/**
	 * @param selectedRepDec the selectedRepDec to set
	 */
	public void setSelectedRepDec(ReportDecision selectedRepDec) {
		this.selectedRepDec = selectedRepDec;
	}

	/**
	 * @return the companyProductTable
	 */
	public List<StatisticBean> getCompanyProductTable() {
		return companyProductTable;
	}

	/**
	 * @param companyProductTable the companyProductTable to set
	 */
	public void setCompanyProductTable(List<StatisticBean> companyProductTable) {
		this.companyProductTable = companyProductTable;
	}

	/**
	 * @return the barChartQualityModel
	 */
	public BarChartModel getBarChartQualityModel() {
		return barChartQualityModel;
	}

	/**
	 * @param barChartQualityModel the barChartQualityModel to set
	 */
	public void setBarChartQualityModel(BarChartModel barChartQualityModel) {
		this.barChartQualityModel = barChartQualityModel;
	}

	/**
	 * @return the barChartPriceModel
	 */
	public BarChartModel getBarChartPriceModel() {
		return barChartPriceModel;
	}

	/**
	 * @param barChartPriceModel the barChartPriceModel to set
	 */
	public void setBarChartPriceModel(BarChartModel barChartPriceModel) {
		this.barChartPriceModel = barChartPriceModel;
	}

	/**
	 * @return the barChartImageModel
	 */
	public BarChartModel getBarChartImageModel() {
		return barChartImageModel;
	}

	/**
	 * @param barChartImageModel the barChartImageModel to set
	 */
	public void setBarChartImageModel(BarChartModel barChartImageModel) {
		this.barChartImageModel = barChartImageModel;
	}

	/**
	 * @return the barChartMarketGameProductSellings
	 */
	public BarChartModel getBarChartMarketGameProductSellings() {
		return barChartMarketGameProductSellings;
	}

	/**
	 * @param barChartMarketGameProductSellings the barChartMarketGameProductSellings to set
	 */
	public void setBarChartMarketGameProductSellings(
			BarChartModel barChartMarketGameProductSellings) {
		this.barChartMarketGameProductSellings = barChartMarketGameProductSellings;
	}

	/**
	 * @return the barChartMarketGameCompanySellings
	 */
	public BarChartModel getBarChartMarketGameCompanySellings() {
		return barChartMarketGameCompanySellings;
	}

	/**
	 * @param barChartMarketGameCompanySellings the barChartMarketGameCompanySellings to set
	 */
	public void setBarChartMarketGameCompanySellings(
			BarChartModel barChartMarketGameCompanySellings) {
		this.barChartMarketGameCompanySellings = barChartMarketGameCompanySellings;
	}

	/**
	 * @return the barChartMarketGameCompanySellingsPerRoundLine
	 */
	public LineChartModel getBarChartMarketGameCompanySellingsPerRoundLine() {
		return barChartMarketGameCompanySellingsPerRoundLine;
	}

	/**
	 * @param barChartMarketGameCompanySellingsPerRoundLine the barChartMarketGameCompanySellingsPerRoundLine to set
	 */
	public void setBarChartMarketGameCompanySellingsPerRoundLine(
			LineChartModel barChartMarketGameCompanySellingsPerRoundLine) {
		this.barChartMarketGameCompanySellingsPerRoundLine = barChartMarketGameCompanySellingsPerRoundLine;
	}

	/**
	 * @return the ownCompDecColumns
	 */
	public List<ColumnModel> getOwnCompDecColumns() {
		return ownCompDecColumns;
	}

	/**
	 * @param ownCompDecColumns the ownCompDecColumns to set
	 */
	public void setOwnCompDecColumns(List<ColumnModel> ownCompDecColumns) {
		this.ownCompDecColumns = ownCompDecColumns;
	}

	/**
	 * @return the ownCompProdColumns
	 */
	public List<ColumnModel> getOwnCompProdColumns() {
		return ownCompProdColumns;
	}

	/**
	 * @param ownCompProdColumns the ownCompProdColumns to set
	 */
	public void setOwnCompProdColumns(List<ColumnModel> ownCompProdColumns) {
		this.ownCompProdColumns = ownCompProdColumns;
	}

	/**
	 * @return the ownCompDecData
	 */
	public List<StatisticBean> getOwnCompDecData() {
		return ownCompDecData;
	}

	/**
	 * @param ownCompDecData the ownCompDecData to set
	 */
	public void setOwnCompDecData(List<StatisticBean> ownCompDecData) {
		this.ownCompDecData = ownCompDecData;
	}

	/**
	 * @return the ownCompProdData
	 */
	public List<StatisticBean> getOwnCompProdData() {
		return ownCompProdData;
	}

	/**
	 * @param ownCompProdData the ownCompProdData to set
	 */
	public void setOwnCompProdData(List<StatisticBean> ownCompProdData) {
		this.ownCompProdData = ownCompProdData;
	}

	/**
	 * @return the companyDecisionColumns
	 */
	public List<ColumnModel> getCompanyDecisionColumns() {
		return companyDecisionColumns;
	}

	/**
	 * @param companyDecisionColumns the companyDecisionColumns to set
	 */
	public void setCompanyDecisionColumns(List<ColumnModel> companyDecisionColumns) {
		this.companyDecisionColumns = companyDecisionColumns;
	}

	/**
	 * @return the companyDecisionsTable
	 */
	public List<StatisticBean> getCompanyDecisionsTable() {
		return companyDecisionsTable;
	}

	/**
	 * @param companyDecisionsTable the companyDecisionsTable to set
	 */
	public void setCompanyDecisionsTable(List<StatisticBean> companyDecisionsTable) {
		this.companyDecisionsTable = companyDecisionsTable;
	}

	/**
	 * @return the agentsTable
	 */
	public List<StatisticBean> getAgentsTable() {
		return agentsTable;
	}

	/**
	 * @param agentsTable the agentsTable to set
	 */
	public void setAgentsTable(List<StatisticBean> agentsTable) {
		this.agentsTable = agentsTable;
	}

	/**
	 * @return the agentsColumns
	 */
	public List<ColumnModel> getAgentsColumns() {
		return agentsColumns;
	}

	/**
	 * @param agentsColumns the agentsColumns to set
	 */
	public void setAgentsColumns(List<ColumnModel> agentsColumns) {
		this.agentsColumns = agentsColumns;
	}

	/**
	 * @return the avgAgentPreference
	 */
	public String getAvgAgentPreference() {
		return avgAgentPreference;
	}

	/**
	 * @param avgAgentPreference the avgAgentPreference to set
	 */
	public void setAvgAgentPreference(String avgAgentPreference) {
		this.avgAgentPreference = avgAgentPreference;
	}

	/**
	 * @return the companySummedUpDecisionsTable
	 */
	public List<StatisticBean> getCompanySummedUpDecisionsTable() {
		return companySummedUpDecisionsTable;
	}

	/**
	 * @param companySummedUpDecisionsTable the companySummedUpDecisionsTable to set
	 */
	public void setCompanySummedUpDecisionsTable(
			List<StatisticBean> companySummedUpDecisionsTable) {
		this.companySummedUpDecisionsTable = companySummedUpDecisionsTable;
	}

	/**
	 * @return the companySummedUpDecisionColumns
	 */
	public List<ColumnModel> getCompanySummedUpDecisionColumns() {
		return companySummedUpDecisionColumns;
	}

	/**
	 * @param companySummedUpDecisionColumns the companySummedUpDecisionColumns to set
	 */
	public void setCompanySummedUpDecisionColumns(
			List<ColumnModel> companySummedUpDecisionColumns) {
		this.companySummedUpDecisionColumns = companySummedUpDecisionColumns;
	}

	/**
	 * @return the amountCompanies
	 */
	public String getAmountCompanies() {
		return amountCompanies;
	}

	/**
	 * @param amountCompanies the amountCompanies to set
	 */
	public void setAmountCompanies(String amountCompanies) {
		this.amountCompanies = amountCompanies;
	}

	/**
	 * @return the amountAgents
	 */
	public String getAmountAgents() {
		return amountAgents;
	}

	/**
	 * @param amountAgents the amountAgents to set
	 */
	public void setAmountAgents(String amountAgents) {
		this.amountAgents = amountAgents;
	}

	/**
	 * @return the amountCompanyProducts
	 */
	public String getAmountCompanyProducts() {
		return amountCompanyProducts;
	}

	/**
	 * @param amountCompanyProducts the amountCompanyProducts to set
	 */
	public void setAmountCompanyProducts(String amountCompanyProducts) {
		this.amountCompanyProducts = amountCompanyProducts;
	}

	/**
	 * @return the amountDifferentProducts
	 */
	public String getAmountDifferentProducts() {
		return amountDifferentProducts;
	}

	/**
	 * @param amountDifferentProducts the amountDifferentProducts to set
	 */
	public void setAmountDifferentProducts(String amountDifferentProducts) {
		this.amountDifferentProducts = amountDifferentProducts;
	}
}
